package com.wenlin.myproduction.ui;

import android.content.Intent;
import android.os.Bundle;

import com.wenlin.myproduction.R;
import com.wenlin.myproduction.base.BaseActivity;
import com.wenlin.myproduction.base.BaseSwipeActivity;
import com.wenlin.myproduction.bean.PrivateBean;
import com.wenlin.myproduction.util.ToastUtils;
import com.wenlin.myproduction.util.ValCommon;
import com.wenlin.myproduction.widget.PicVideoBannerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * @author 文琳
 * @Email 377979485@qq.com
 * @desc 图片视频轮播图
 * @time 2023-12-26 周二 21:01
 */
public class PicVideoBannerActivity extends BaseSwipeActivity {
    @BindView(R.id.banner)
    PicVideoBannerView banner;

    public static void start(BaseActivity activity) {
        Intent intent = new Intent(activity, PicVideoBannerActivity.class);
        if (activity != null && !activity.isDestroyed() && !activity.isFinishing())
            activity.startActivity(intent);
    }

    @Override
    public int getContentView() {
        return R.layout.activity_pic_video_banner;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(ValCommon.PIC_VIDEO_BANNER);
        List<PrivateBean> list = new ArrayList<>();
        list.add(new PrivateBean("https://tcs.teambition.net/thumbnail/3124d719c90c5ac8c8d0b6dd346baabc640c/w/20000/h/20000", false, false));
        list.add(new PrivateBean("https://tcs.teambition.net/thumbnail/3122c489cd05f43fd31737834a8b5407df70/w/20000/h/20000", true, false));
        list.add(new PrivateBean("https://tcs.teambition.net/thumbnail/312238f4234e97973d0781b8232a06a252b1/w/20000/h/20000", false, true));
        list.add(new PrivateBean("https://tcs.teambition.net/thumbnail/31240b2f1d2e5eb24202bdce890f3c6649e9/w/20000/h/20000", true, true));
        banner.setPrivateList(list);
        banner.setOnItemClickListener(new PicVideoBannerView.onItemClickListener() {
            @Override
            public void onClickWithUnlock(PrivateBean bean, int currentIndex) {
                ToastUtils.getInstance().showInfo("点击了公开条目");
            }

            @Override
            public void onClickWithLock(PrivateBean bean, int currentIndex) {
                ToastUtils.getInstance().showInfo("点击了私密条目");
            }
        });
    }

}
